

//
//  CPJHomePageModel.swift
//  Sina
//
//  Created by YYY on 2017/8/14.
//  Copyright © 2017年 成品家（北京）网路科技有限公司. All rights reserved.
//

import UIKit

//首页列表展示model
//定义模型变量
//定义可选对象，一定用？进行初始化

class CPJHomePageModel: NSObject {
    //微博ID
    var id: Int64 = 0
    
    //微博信息内容
    var text: String?
    
    //微博创建时间
    var created_at: String?
    {
        didSet
        {
            createdDate = Date.sinaStringConvertToDate(string: created_at ?? "")
        }
    }
    
    //微博创建日期
    var createdDate: Date?
    
    //微博来源
    var source: String?
    {
        didSet
        {
            source = "来自" + (source?.regularExpression()?.text ?? "")
        }
    }
    
    //用户信息
    var user: CPJUserModel?
    
    //转发数
    var reposts_count: Int = 0
    
    //评论数
    var comments_count: Int = 0
   
    //表态数
    var attitudes_count: Int = 0
  
    //图像
    var pic_urls: [CPJPictureModel]?
    //被转发的微博
    var retweeted_status: CPJHomePageModel?
    
    //计算型数据
    override var description: String{
        
        return yy_modelDescription()
    }
    
    class func modelContainerPropertyGenericClass() -> [String: AnyClass]
    {
        return ["pic_urls": CPJPictureModel.self]
    }

}
